$NG.AllReady(function (
    editPage,
    { useAction, useValuesChange, useUpdateRows, useDataIndexChange, useClick }
) {
    const mstform = $NG.getCmpApi("p_form_employ_task")
	const dgrid1 = $NG.getCmpApi("p_form_employ_task_d")
    useValuesChange(({args})=>{
        getTaskInfo()
    },"p_form_employ_task.u_name")

    useUpdateRows(({args})=>{
        console.log(`表格监听`);
        const _d1arr = dgrid1.getRows()
        let u_self_score=0
        let u_reevaluate_score = 0
        _d1arr.forEach(element => {
            u_self_score+=element.u_self_score?element.u_self_score:0
            u_reevaluate_score+=element.u_reevaluate_score?element.u_reevaluate_score:0
        });
        console.log('数组', u_reevaluate_score,u_self_score);
        $NG.updateState((updater)=>{
            updater.data.p_form_employ_task.setProps({
                u_self_score:u_self_score,
                u_reevaluate_score:u_reevaluate_score
            })
        })
    },"p_form_employ_task_d")
    getTaskInfo()
    function getTaskInfo(){
        dgrid1.clearRows()
        $NG.execServer("getTaskInfo", {}, (res) => {
            const _data = JSON.parse(res.data)
            console.log(`获取用工模板`, _data,res);
            const _rowArr = []
            _data.forEach(element => {
                _rowArr.push({
                    u_type:element.extendObjects.u_category,
                    u_score:element.extendObjects.u_score
                })
            });
            dgrid1.addRows(_rowArr)
        })
    }
});